package com.daotonginfo.generator.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import com.google.common.base.CaseFormat;


@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Column {
    private String name;
    private String comment;
    private String type;
    private int length;
    private String bigName;
    private String columnName;
    private String isnull;
    private String columnType;
    private String columnKey;
    private String extra;

    public String getName() {
        return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, columnName);
        //StringUtil.underlineToCamel(columnName);
    }

    public String getBigName() {
//        return columnName.substring(0, 1).toUpperCase() + StringUtil.underlineToCamel(columnName.substring(1));
        return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, columnName);
    }

}
